home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Technology Seed / Jan. '98 ATS.toast / QuickTime™ 3.0b11 / QTPublicInterfaces / CIncludes / CMICCProfile.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-12  |  29.0 KB  |  890 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        CMICCProfile.h
  3.  
  4.      Contains:    Definitions for ColorSync 2.0 profile
  5.  
  6.      Version:    Technology:    ColorSync 2.1
  7.                  Release:    QuickTime 3.0 Beta
  8.  
  9.      Copyright:    © 1994-1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __CMICCPROFILE__
  19. #define __CMICCPROFILE__
  20.  
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24.  
  25.  
  26.  
  27. #if PRAGMA_ONCE
  28. #pragma once
  29. #endif
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34.  
  35. #if PRAGMA_IMPORT
  36. #pragma import on
  37. #endif
  38.  
  39. #if PRAGMA_STRUCT_ALIGN
  40.     #pragma options align=mac68k
  41. #elif PRAGMA_STRUCT_PACKPUSH
  42.     #pragma pack(push, 2)
  43. #elif PRAGMA_STRUCT_PACK
  44.     #pragma pack(2)
  45. #endif
  46.  
  47. /* Current CMProfile.header.profileVersion Major: 2, Minor: 0, Stage: Developement (x20), Prerelease:0x01 */
  48.  
  49. enum {
  50.     cmCS2ProfileVersion            = 0x02000000
  51. };
  52.  
  53. /* Current Major version number */
  54.  
  55. enum {
  56.     cmCurrentProfileMajorVersion = 0x02000000
  57. };
  58.  
  59. /* magic cookie number for anonymous file ID */
  60.  
  61. enum {
  62.     cmMagicNumber                = FOUR_CHAR_CODE('acsp')
  63. };
  64.  
  65. /* ColorSync profile version 1.0 */
  66.  
  67. enum {
  68.     cmCS1ProfileVersion            = 0x00000100
  69. };
  70.  
  71.  
  72. /************************************************************************/
  73. /*************** ColorSync 2.0 profile specification ********************/
  74. /************************************************************************/
  75. /**** flags field  ****/
  76.  
  77. enum {
  78.     cmICCReservedFlagsMask        = 0x0000FFFF,                    /* these bits of the flags field are defined and reserved by ICC */
  79.     cmEmbeddedMask                = 0x00000001,                    /* if bit 0 is 0 then not embedded profile, if 1 then embedded profile */
  80.     cmEmbeddedUseMask            = 0x00000002,                    /* if bit 1 is 0 then ok to use anywhere, if 1 then ok to use as embedded profile only */
  81.     cmCMSReservedFlagsMask        = (long)0xFFFF0000,                /* these bits of the flags field are defined and reserved by CMS vendor */
  82.     cmQualityMask                = 0x00030000,                    /* if bits 16-17 is 0 then normal, if 1 then draft, if 2 then best */
  83.     cmInterpolationMask            = 0x00040000,                    /* if bit 18 is 0 then interpolation, if 1 then lookup only */
  84.     cmGamutCheckingMask            = 0x00080000                    /* if bit 19 is 0 then create gamut checking info, if 1 then no gamut checking info */
  85. };
  86.  
  87. /* copyright-protection flag options */
  88.  
  89. enum {
  90.     cmEmbeddedProfile            = 0,                            /* 0 is not embedded profile, 1 is embedded profile */
  91.     cmEmbeddedUse                = 1                                /* 0 is to use anywhere, 1 is to use as embedded profile only */
  92. };
  93.  
  94. /* speed and quality flag options */
  95.  
  96. enum {
  97.     cmNormalMode                = 0,                            /* it uses the least significent two bits in the high word of flag */
  98.     cmDraftMode                    = 1,                            /* it should be evaulated like this: right shift 16 bits first, mask off the */
  99.     cmBestMode                    = 2                                /* high 14 bits, and then compare with the enum to determine the option value */
  100. };
  101.  
  102.  
  103. /**** deviceAttributes fields ****/
  104.  
  105. enum {
  106.     cmICCReservedAttr0Mask        = 0x0000FFFF,                    /* these bits of the deviceAttributes[0] field are defined and reserved by ICC */
  107.     cmReflectiveTransparentMask    = 0x00000001,                    /* if bit 0 is 0 then reflective media, if 1 then transparency media */
  108.     cmGlossyMatteMask            = 0x00000002,                    /* if bit 1 is 0 then glossy, if 1 then matte */
  109.     cmVendorReservedAttr0Mask    = (long)0xFFFF0000,                /* these bits of the deviceAttributes[0] field are defined and reserved by device vendor */
  110.     cmVendorReservedAttr1Mask    = (long)0xFFFFFFFF                /* these bits of the deviceAttributes[1] field are defined and reserved by device vendor */
  111. };
  112.  
  113. /* device/media attributes element values  */
  114.  
  115. enum {
  116.     cmReflective                = 0,                            /* if bit 0 is 0 then reflective media, if 1 then transparency media */
  117.     cmGlossy                    = 1                                /* if bit 1 is 0 then glossy, if 1 then matte */
  118. };
  119.  
  120.  
  121. /**** renderingIntent field ****/
  122.  
  123. enum {
  124.     cmPerceptual                = 0,                            /* Photographic images */
  125.     cmRelativeColorimetric        = 1,                            /* Logo Colors */
  126.     cmSaturation                = 2,                            /* Business graphics */
  127.     cmAbsoluteColorimetric        = 3                                /* Logo Colors */
  128. };
  129.  
  130.  
  131.  
  132. /* data type element values */
  133.  
  134. enum {
  135.     cmAsciiData                    = 0,
  136.     cmBinaryData                = 1
  137. };
  138.  
  139. /* screen encodings  */
  140.  
  141. enum {
  142.     cmPrtrDefaultScreens        = 0,                            /* Use printer default screens.  0 is false, 1 is ture */
  143.     cmLinesPer                    = 1                                /* 0 is LinesPerCm, 1 is LinesPerInch */
  144. };
  145.  
  146. /* 2.0 tag type information */
  147.  
  148. enum {
  149.     cmNumHeaderElements            = 10
  150. };
  151.  
  152. /* public tags */
  153.  
  154. enum {
  155.     cmAToB0Tag                    = FOUR_CHAR_CODE('A2B0'),
  156.     cmAToB1Tag                    = FOUR_CHAR_CODE('A2B1'),
  157.     cmAToB2Tag                    = FOUR_CHAR_CODE('A2B2'),
  158.     cmBlueColorantTag            = FOUR_CHAR_CODE('bXYZ'),
  159.     cmBlueTRCTag                = FOUR_CHAR_CODE('bTRC'),
  160.     cmBToA0Tag                    = FOUR_CHAR_CODE('B2A0'),
  161.     cmBToA1Tag                    = FOUR_CHAR_CODE('B2A1'),
  162.     cmBToA2Tag                    = FOUR_CHAR_CODE('B2A2'),
  163.     cmCalibrationDateTimeTag    = FOUR_CHAR_CODE('calt'),
  164.     cmCharTargetTag                = FOUR_CHAR_CODE('targ'),
  165.     cmCopyrightTag                = FOUR_CHAR_CODE('cprt'),
  166.     cmDeviceMfgDescTag            = FOUR_CHAR_CODE('dmnd'),
  167.     cmDeviceModelDescTag        = FOUR_CHAR_CODE('dmdd'),
  168.     cmGamutTag                    = FOUR_CHAR_CODE('gamt'),
  169.     cmGrayTRCTag                = FOUR_CHAR_CODE('kTRC'),
  170.     cmGreenColorantTag            = FOUR_CHAR_CODE('gXYZ'),
  171.     cmGreenTRCTag                = FOUR_CHAR_CODE('gTRC'),
  172.     cmLuminanceTag                = FOUR_CHAR_CODE('lumi'),
  173.     cmMeasurementTag            = FOUR_CHAR_CODE('meas'),
  174.     cmMediaBlackPointTag        = FOUR_CHAR_CODE('bkpt'),
  175.     cmMediaWhitePointTag        = FOUR_CHAR_CODE('wtpt'),
  176.     cmNamedColorTag                = FOUR_CHAR_CODE('ncol'),
  177.     cmNamedColor2Tag            = FOUR_CHAR_CODE('ncl2'),
  178.     cmPreview0Tag                = FOUR_CHAR_CODE('pre0'),
  179.     cmPreview1Tag                = FOUR_CHAR_CODE('pre1'),
  180.     cmPreview2Tag                = FOUR_CHAR_CODE('pre2'),
  181.     cmProfileDescriptionTag        = FOUR_CHAR_CODE('desc'),
  182.     cmProfileSequenceDescTag    = FOUR_CHAR_CODE('pseq'),
  183.     cmPS2CRD0Tag                = FOUR_CHAR_CODE('psd0'),
  184.     cmPS2CRD1Tag                = FOUR_CHAR_CODE('psd1'),
  185.     cmPS2CRD2Tag                = FOUR_CHAR_CODE('psd2'),
  186.     cmPS2CRD3Tag                = FOUR_CHAR_CODE('psd3'),
  187.     cmPS2CSATag                    = FOUR_CHAR_CODE('ps2s'),
  188.     cmPS2RenderingIntentTag        = FOUR_CHAR_CODE('ps2i'),
  189.     cmRedColorantTag            = FOUR_CHAR_CODE('rXYZ'),
  190.     cmRedTRCTag                    = FOUR_CHAR_CODE('rTRC'),
  191.     cmScreeningDescTag            = FOUR_CHAR_CODE('scrd'),
  192.     cmScreeningTag                = FOUR_CHAR_CODE('scrn'),
  193.     cmTechnologyTag                = FOUR_CHAR_CODE('tech'),
  194.     cmUcrBgTag                    = FOUR_CHAR_CODE('bfd '),
  195.     cmViewingConditionsDescTag    = FOUR_CHAR_CODE('vued'),
  196.     cmViewingConditionsTag        = FOUR_CHAR_CODE('view')
  197. };
  198.  
  199. /* custom tags */
  200.  
  201. enum {
  202.     cmPS2CRDVMSizeTag            = FOUR_CHAR_CODE('psvm')
  203. };
  204.  
  205. /* technology tag descriptions */
  206.  
  207. enum {
  208.     cmTechnologyFilmScanner        = FOUR_CHAR_CODE('fscn'),
  209.     cmTechnologyReflectiveScanner = FOUR_CHAR_CODE('rscn'),
  210.     cmTechnologyInkJetPrinter    = FOUR_CHAR_CODE('ijet'),
  211.     cmTechnologyThermalWaxPrinter = FOUR_CHAR_CODE('twax'),
  212.     cmTechnologyElectrophotographicPrinter = FOUR_CHAR_CODE('epho'),
  213.     cmTechnologyElectrostaticPrinter = FOUR_CHAR_CODE('esta'),
  214.     cmTechnologyDyeSublimationPrinter = FOUR_CHAR_CODE('dsub'),
  215.     cmTechnologyPhotographicPaperPrinter = FOUR_CHAR_CODE('rpho'),
  216.     cmTechnologyFilmWriter        = FOUR_CHAR_CODE('fprn'),
  217.     cmTechnologyVideoMonitor    = FOUR_CHAR_CODE('vidm'),
  218.     cmTechnologyVideoCamera        = FOUR_CHAR_CODE('vidc'),
  219.     cmTechnologyProjectionTelevision = FOUR_CHAR_CODE('pjtv'),
  220.     cmTechnologyCRTDisplay        = FOUR_CHAR_CODE('CRT '),
  221.     cmTechnologyPMDisplay        = FOUR_CHAR_CODE('PMD '),
  222.     cmTechnologyAMDisplay        = FOUR_CHAR_CODE('AMD '),
  223.     cmTechnologyPhotoCD            = FOUR_CHAR_CODE('KPCD'),
  224.     cmTechnologyPhotoImageSetter = FOUR_CHAR_CODE('imgs'),
  225.     cmTechnologyGravure            = FOUR_CHAR_CODE('grav'),
  226.     cmTechnologyOffsetLithography = FOUR_CHAR_CODE('offs'),
  227.     cmTechnologySilkscreen        = FOUR_CHAR_CODE('silk'),
  228.     cmTechnologyFlexography        = FOUR_CHAR_CODE('flex')
  229. };
  230.  
  231. /* type signatures */
  232.  
  233. enum {
  234.     cmSigCurveType                = FOUR_CHAR_CODE('curv'),
  235.     cmSigDataType                = FOUR_CHAR_CODE('data'),
  236.     cmSigDateTimeType            = FOUR_CHAR_CODE('dtim'),
  237.     cmSigLut16Type                = FOUR_CHAR_CODE('mft2'),
  238.     cmSigLut8Type                = FOUR_CHAR_CODE('mft1'),
  239.     cmSigMeasurementType        = FOUR_CHAR_CODE('meas'),
  240.     cmSigNamedColorType            = FOUR_CHAR_CODE('ncol'),
  241.     cmSigNamedColor2Type        = FOUR_CHAR_CODE('ncl2'),
  242.     cmSigProfileDescriptionType    = FOUR_CHAR_CODE('desc'),
  243.     cmSigScreeningType            = FOUR_CHAR_CODE('scrn'),
  244.     cmSigS15Fixed16Type            = FOUR_CHAR_CODE('sf32'),
  245.     cmSigSignatureType            = FOUR_CHAR_CODE('sig '),
  246.     cmSigTextType                = FOUR_CHAR_CODE('text'),
  247.     cmSigU16Fixed16Type            = FOUR_CHAR_CODE('uf32'),
  248.     cmSigU1Fixed15Type            = FOUR_CHAR_CODE('uf16'),
  249.     cmSigUInt32Type                = FOUR_CHAR_CODE('ui32'),
  250.     cmSigUInt64Type                = FOUR_CHAR_CODE('ui64'),
  251.     cmSigUInt8Type                = FOUR_CHAR_CODE('ui08'),
  252.     cmSigViewingConditionsType    = FOUR_CHAR_CODE('view'),
  253.     cmSigXYZType                = FOUR_CHAR_CODE('XYZ ')
  254. };
  255.  
  256. /* Measurement type encodings */
  257. /* Measurement Flare */
  258.  
  259. enum {
  260.     cmFlare0                    = 0x00000000,
  261.     cmFlare100                    = 0x00000001
  262. };
  263.  
  264. /* Measurement Geometry    */
  265.  
  266. enum {
  267.     cmGeometryUnknown            = 0x00000000,
  268.     cmGeometry045or450            = 0x00000001,
  269.     cmGeometry0dord0            = 0x00000002
  270. };
  271.  
  272. /* Standard Observer    */
  273.  
  274. enum {
  275.     cmStdobsUnknown                = 0x00000000,
  276.     cmStdobs1931TwoDegrees        = 0x00000001,
  277.     cmStdobs1964TenDegrees        = 0x00000002
  278. };
  279.  
  280. /* Standard Illuminant */
  281.  
  282. enum {
  283.     cmIlluminantUnknown            = 0x00000000,
  284.     cmIlluminantD50                = 0x00000001,
  285.     cmIlluminantD65                = 0x00000002,
  286.     cmIlluminantD93                = 0x00000003,
  287.     cmIlluminantF2                = 0x00000004,
  288.     cmIlluminantD55                = 0x00000005,
  289.     cmIlluminantA                = 0x00000006,
  290.     cmIlluminantEquiPower        = 0x00000007,
  291.     cmIlluminantF8                = 0x00000008
  292. };
  293.  
  294. /* Spot Function Value */
  295.  
  296. enum {
  297.     cmSpotFunctionUnknown        = 0,
  298.     cmSpotFunctionDefault        = 1,
  299.     cmSpotFunctionRound            = 2,
  300.     cmSpotFunctionDiamond        = 3,
  301.     cmSpotFunctionEllipse        = 4,
  302.     cmSpotFunctionLine            = 5,
  303.     cmSpotFunctionSquare        = 6,
  304.     cmSpotFunctionCross            = 7
  305. };
  306.  
  307. /* Color Space Signatures */
  308.  
  309. enum {
  310.     cmXYZData                    = FOUR_CHAR_CODE('XYZ '),
  311.     cmLabData                    = FOUR_CHAR_CODE('Lab '),
  312.     cmLuvData                    = FOUR_CHAR_CODE('Luv '),
  313.     cmYxyData                    = FOUR_CHAR_CODE('Yxy '),
  314.     cmRGBData                    = FOUR_CHAR_CODE('RGB '),
  315.     cmGrayData                    = FOUR_CHAR_CODE('GRAY'),
  316.     cmHSVData                    = FOUR_CHAR_CODE('HSV '),
  317.     cmHLSData                    = FOUR_CHAR_CODE('HLS '),
  318.     cmCMYKData                    = FOUR_CHAR_CODE('CMYK'),
  319.     cmCMYData                    = FOUR_CHAR_CODE('CMY '),
  320.     cmMCH5Data                    = FOUR_CHAR_CODE('MCH5'),
  321.     cmMCH6Data                    = FOUR_CHAR_CODE('MCH6'),
  322.     cmMCH7Data                    = FOUR_CHAR_CODE('MCH7'),
  323.     cmMCH8Data                    = FOUR_CHAR_CODE('MCH8')
  324. };
  325.  
  326. /* profileClass enumerations */
  327.  
  328. enum {
  329.     cmInputClass                = FOUR_CHAR_CODE('scnr'),
  330.     cmDisplayClass                = FOUR_CHAR_CODE('mntr'),
  331.     cmOutputClass                = FOUR_CHAR_CODE('prtr'),
  332.     cmLinkClass                    = FOUR_CHAR_CODE('link'),
  333.     cmAbstractClass                = FOUR_CHAR_CODE('abst'),
  334.     cmColorSpaceClass            = FOUR_CHAR_CODE('spac'),
  335.     cmNamedColorClass            = FOUR_CHAR_CODE('nmcl')
  336. };
  337.  
  338. /* platform enumerations */
  339.  
  340. enum {
  341.     cmMacintosh                    = FOUR_CHAR_CODE('APPL'),
  342.     cmMicrosoft                    = FOUR_CHAR_CODE('MSFT'),
  343.     cmSolaris                    = FOUR_CHAR_CODE('SUNW'),
  344.     cmSiliconGraphics            = FOUR_CHAR_CODE('SGI '),
  345.     cmTaligent                    = FOUR_CHAR_CODE('TGNT')
  346. };
  347.  
  348. /* ColorSync 1.0 elements */
  349.  
  350. enum {
  351.     cmCS1ChromTag                = FOUR_CHAR_CODE('chrm'),
  352.     cmCS1TRCTag                    = FOUR_CHAR_CODE('trc '),
  353.     cmCS1NameTag                = FOUR_CHAR_CODE('name'),
  354.     cmCS1CustTag                = FOUR_CHAR_CODE('cust')
  355. };
  356.  
  357. /* General element data types */
  358.  
  359. struct CMDateTime {
  360.     unsigned short                     year;
  361.     unsigned short                     month;
  362.     unsigned short                     dayOfTheMonth;
  363.     unsigned short                     hours;
  364.     unsigned short                     minutes;
  365.     unsigned short                     seconds;
  366. };
  367. typedef struct CMDateTime                CMDateTime;
  368.  
  369. struct CMFixedXYZColor {
  370.     Fixed                             X;
  371.     Fixed                             Y;
  372.     Fixed                             Z;
  373. };
  374. typedef struct CMFixedXYZColor            CMFixedXYZColor;
  375.  
  376. typedef unsigned short                     CMXYZComponent;
  377.  
  378. struct CMXYZColor {
  379.     CMXYZComponent                     X;
  380.     CMXYZComponent                     Y;
  381.     CMXYZComponent                     Z;
  382. };
  383. typedef struct CMXYZColor                CMXYZColor;
  384.  
  385. struct CM2Header {
  386.     unsigned long                     size;                        /* This is the total size of the Profile */
  387.     OSType                             CMMType;                    /* CMM signature,  Registered with CS2 consortium  */
  388.     unsigned long                     profileVersion;                /* Version of CMProfile format */
  389.     OSType                             profileClass;                /* input, display, output, devicelink, abstract, or color conversion profile type */
  390.     OSType                             dataColorSpace;                /* color space of data */
  391.     OSType                             profileConnectionSpace;        /* profile connection color space */
  392.     CMDateTime                         dateTime;                    /* date and time of profile creation */
  393.     OSType                             CS2profileSignature;        /* 'acsp' constant ColorSync 2.0 file ID */
  394.     OSType                             platform;                    /* primary profile platform, Registered with CS2 consortium */
  395.     unsigned long                     flags;                        /* profile flags */
  396.     OSType                             deviceManufacturer;            /* Registered with ICC consortium */
  397.     unsigned long                     deviceModel;                /* Registered with ICC consortium */
  398.     unsigned long                     deviceAttributes[2];        /* Attributes like paper type */
  399.     unsigned long                     renderingIntent;            /* preferred rendering intent of tagged object */
  400.     CMFixedXYZColor                 white;                        /* profile illuminant */
  401.     OSType                             creator;                    /* profile creator */
  402.     char                             reserved[44];                /* reserved for future use */
  403. };
  404. typedef struct CM2Header                CM2Header;
  405.  
  406. struct CMTagRecord {
  407.     OSType                             tag;                        /* Registered with CS2 consortium */
  408.     unsigned long                     elementOffset;                /* Relative to start of CMProfile */
  409.     unsigned long                     elementSize;
  410. };
  411. typedef struct CMTagRecord                CMTagRecord;
  412.  
  413. struct CMTagElemTable {
  414.     unsigned long                     count;
  415.     CMTagRecord                     tagList[1];                    /* Variable size */
  416. };
  417. typedef struct CMTagElemTable            CMTagElemTable;
  418. /* External 0x02002001 CMProfile */
  419.  
  420. struct CM2Profile {
  421.     CM2Header                         header;
  422.     CMTagElemTable                     tagTable;
  423.     char                             elemData[1];                /* Tagged element storage. Variable size */
  424. };
  425. typedef struct CM2Profile                CM2Profile;
  426. typedef CM2Profile *                    CM2ProfilePtr;
  427. typedef CM2ProfilePtr *                    CM2ProfileHandle;
  428. /* Tag Type Definitions */
  429.  
  430. struct CMCurveType {
  431.     OSType                             typeDescriptor;                /* 'curv' */
  432.     unsigned long                     reserved;                    /* fill with 0x00 */
  433.     unsigned long                     countValue;                    /* number of entries in table that follows */
  434.     unsigned short                     data[1];                    /* Tagged element storage. Variable size */
  435. };
  436. typedef struct CMCurveType                CMCurveType;
  437.  
  438. struct CMDataType {
  439.     OSType                             typeDescriptor;                /* 'data' */
  440.     unsigned long                     reserved;                    /* fill with 0x00 */
  441.     unsigned long                     dataFlag;                    /* 0 = ASCII, 1 = binary */
  442.     char                             data[1];                    /* Tagged element storage. Variable size */
  443. };
  444. typedef struct CMDataType                CMDataType;
  445.  
  446. struct CMDateTimeType {
  447.     OSType                             typeDescriptor;                /* 'dtim' */
  448.     unsigned long                     reserved;
  449.     CMDateTime                         dateTime;
  450. };
  451. typedef struct CMDateTimeType            CMDateTimeType;
  452.  
  453. struct CMLut16Type {
  454.     OSType                             typeDescriptor;                /* 'mft2' */
  455.     unsigned long                     reserved;                    /* fill with 0x00 */
  456.     unsigned char                     inputChannels;                /* Number of input channels */
  457.     unsigned char                     outputChannels;                /* Number of output channels */
  458.     unsigned char                     gridPoints;                    /* Number of clutTable grid points */
  459.     unsigned char                     reserved2;                    /* fill with 0x00 */
  460.     Fixed                             matrix[3][3];                /* */
  461.     unsigned short                     inputTableEntries;            /* */
  462.     unsigned short                     outputTableEntries;            /* */
  463.     unsigned short                     inputTable[1];                /* Variable size */
  464.     unsigned short                     CLUT[1];                    /* Variable size */
  465.     unsigned short                     outputTable[1];                /* Variable size */
  466. };
  467. typedef struct CMLut16Type                CMLut16Type;
  468.  
  469. struct CMLut8Type {
  470.     OSType                             typeDescriptor;                /* 'mft1' */
  471.     unsigned long                     reserved;                    /* fill with 0x00 */
  472.     unsigned char                     inputChannels;                /* */
  473.     unsigned char                     outputChannels;                /* */
  474.     unsigned char                     gridPoints;                    /* */
  475.     unsigned char                     reserved2;                    /* fill with 0x00 */
  476.     Fixed                             matrix[3][3];                /* */
  477.     unsigned char                     inputTable[256];            /* fixed size of 256 */
  478.     unsigned char                     CLUT[2];                    /* Variable size */
  479.     unsigned char                     outputTable[256];            /* fixed size of 256 */
  480. };
  481. typedef struct CMLut8Type                CMLut8Type;
  482.  
  483. struct CMMeasurementType {
  484.     OSType                             typeDescriptor;                /* 'meas' */
  485.     unsigned long                     reserved;                    /* fill with 0x00 */
  486.     unsigned long                     standardObserver;            /* 0 : unknown, 1 : CIE 1931, 2 : CIE 1964 */
  487.     CMFixedXYZColor                 backingXYZ;                    /* absolute XYZ values of backing */
  488.     unsigned long                     geometry;                    /* 0 : unknown, 1 : 0/45 or 45/0, 2 :0/d or d/0 */
  489.     unsigned long                     flare;                        /* 0 : 0%, 1 : 100% flare */
  490.     unsigned long                     illuminant;                    /* standard illuminant */
  491. };
  492. typedef struct CMMeasurementType        CMMeasurementType;
  493.  
  494. struct CMNamedColorType {
  495.     OSType                             typeDescriptor;                /* 'ncol' */
  496.     unsigned long                     reserved;                    /* fill with 0x00 */
  497.     unsigned long                     vendorFlag;                    /* */
  498.     unsigned long                     count;                        /* count of named colors in array that follows */
  499.     unsigned char                     prefixName[1];                /* Variable size, max = 32, to access fields after this one, have to count bytes */
  500.     unsigned char                     suffixName[1];                /* Variable size, max = 32 */
  501.     char                             data[1];                    /* varaible size data as explained below */
  502. };
  503. typedef struct CMNamedColorType            CMNamedColorType;
  504. /*    
  505.     A variable size array of structs appears as the last block of data
  506.     in the above struct, CMNamedColorType.  The data structure
  507.     is as follows: (example in C)
  508.     
  509.      struct {                                             
  510.             unsigned char    rootName[1];                 * Variable size, max = 32 
  511.             unsigned char    colorCoords[1];                 * Variable size  
  512.      } colorName[1];                                     * Variable size  
  513. */
  514.  
  515. struct CMNamedColor2Type {
  516.     OSType                             typeDescriptor;                /* 'ncl2' */
  517.     unsigned long                     reserved;                    /* fill with 0x00 */
  518.     unsigned long                     vendorFlag;                    /* lower 16 bits reserved for ICC use */
  519.     unsigned long                     count;                        /* count of named colors in array that follows */
  520.     unsigned long                     deviceChannelCount;            /* number of device channels, 0 indicates no device value available */
  521.     unsigned char                     prefixName[32];                /* 32 byte field.  7 bit ASCII null terminated */
  522.     unsigned char                     suffixName[32];                /* 32 byte field.  7 bit ASCII null terminated */
  523.     char                             data[1];                    /* varaible size data as explained below */
  524. };
  525. typedef struct CMNamedColor2Type        CMNamedColor2Type;
  526. /*    
  527.     A variable size array of structs appears as the last block of data
  528.     in the above struct, CMNamedColor2Type.  The data structure
  529.     is as follows: (example in C)
  530.     
  531.      struct {                                             
  532.             unsigned char    rootName[1];                 * 32 byte field.  7 bit ASCII null terminated
  533.             unsigned char    PCSColorCoords[1];             * Variable size  
  534.             unsigned char    DeviceColorCoords[1];         * Variable size  
  535.      } colorName2[1];                                     * Variable size  
  536. */
  537.  
  538.  
  539. struct CMTextDescriptionType {
  540.     OSType                             typeDescriptor;                /* 'desc' */
  541.     unsigned long                     reserved;                    /* fill with 0x00 */
  542.     unsigned long                     ASCIICount;                    /* the count of "bytes" */
  543.     unsigned char                     ASCIIName[2];                /* Variable size, to access fields after this one, have to count bytes */
  544.     unsigned long                     UniCodeCode;
  545.     unsigned long                     UniCodeCount;                /* the count of characters, each character has two bytes */
  546.     unsigned char                     UniCodeName[2];                /* Variable size */
  547.     short                             ScriptCodeCode;
  548.     unsigned char                     ScriptCodeCount;            /* the count of "bytes" */
  549.     unsigned char                     ScriptCodeName[2];            /* Variable size */
  550. };
  551. typedef struct CMTextDescriptionType    CMTextDescriptionType;
  552.  
  553. struct CMTextType {
  554.     OSType                             typeDescriptor;                /* 'text' */
  555.     unsigned long                     reserved;                    /* fill with 0x00 */
  556.     unsigned char                     text[1];                    /* count of text is obtained from tag size element */
  557. };
  558. typedef struct CMTextType                CMTextType;
  559.  
  560. struct CMScreeningType {
  561.     OSType                             typeDescriptor;                /* 'scrn' */
  562.     unsigned long                     reserved;                    /* fill with 0x00 */
  563.     unsigned long                     screeningFlag;                /* bit 0 : use printer default screens, bit 1 : inch/cm */
  564.     unsigned long                     channelCount;
  565.     char                             data[1];                    /* varaible size data as explained below */
  566. };
  567. typedef struct CMScreeningType            CMScreeningType;
  568. /*
  569.     A variable size array of structs appears as the last block of data
  570.     in the above struct, CMScreeningType.  The data structure
  571.     is as follows: (example in C)
  572.     
  573.     struct {
  574.         Fixed            frequency;
  575.         Fixed            angle;
  576.         unsigned long    sportFunction;
  577.      }    channelScreening[1];                             * Variable size 
  578. */
  579.  
  580. struct CMSignatureType {
  581.     OSType                             typeDescriptor;                /* 'sig ' */
  582.     unsigned long                     reserved;                    /* fill with 0x00 */
  583.     OSType                             signature;
  584. };
  585. typedef struct CMSignatureType            CMSignatureType;
  586.  
  587. struct CMS15Fixed16ArrayType {
  588.     OSType                             typeDescriptor;                /* 'sf32' */
  589.     unsigned long                     reserved;                    /* fill with 0x00 */
  590.     Fixed                             value[1];                    /* Variable size */
  591. };
  592. typedef struct CMS15Fixed16ArrayType    CMS15Fixed16ArrayType;
  593.  
  594. struct CMU16Fixed16ArrayType {
  595.     OSType                             typeDescriptor;                /* 'uf32' */
  596.     unsigned long                     reserved;                    /* fill with 0x00 */
  597.     unsigned long                     value[1];                    /* Variable size */
  598. };
  599. typedef struct CMU16Fixed16ArrayType    CMU16Fixed16ArrayType;
  600.  
  601. struct CMUInt16ArrayType {
  602.     OSType                             typeDescriptor;                /* 'ui16' */
  603.     unsigned long                     reserved;                    /* fill with 0x00 */
  604.     unsigned short                     value[1];                    /* Variable size */
  605. };
  606. typedef struct CMUInt16ArrayType        CMUInt16ArrayType;
  607.  
  608. struct CMUInt32ArrayType {
  609.     OSType                             typeDescriptor;                /* 'ui32' */
  610.     unsigned long                     reserved;                    /* fill with 0x00 */
  611.     unsigned long                     value[1];                    /* Variable size */
  612. };
  613. typedef struct CMUInt32ArrayType        CMUInt32ArrayType;
  614.  
  615. struct CMUInt64ArrayType {
  616.     OSType                             typeDescriptor;                /* 'ui64' */
  617.     unsigned long                     reserved;                    /* fill with 0x00 */
  618.     unsigned long                     value[1];                    /* Variable size (x2) */
  619. };
  620. typedef struct CMUInt64ArrayType        CMUInt64ArrayType;
  621.  
  622. struct CMUInt8ArrayType {
  623.     OSType                             typeDescriptor;                /* 'ui08' */
  624.     unsigned long                     reserved;                    /* fill with 0x00 */
  625.     unsigned char                     value[1];                    /* Variable size */
  626. };
  627. typedef struct CMUInt8ArrayType            CMUInt8ArrayType;
  628.  
  629. struct CMViewingConditionsType {
  630.     OSType                             typeDescriptor;                /* 'view' */
  631.     unsigned long                     reserved;                    /* fill with 0x00 */
  632.     CMFixedXYZColor                 illuminant;                    /* absolute XYZs of illuminant  in cd/m^2 */
  633.     CMFixedXYZColor                 surround;                    /* absolute XYZs of surround in cd/m^2 */
  634.     unsigned long                     stdIlluminant;                /* see definitions of std illuminants */
  635. };
  636. typedef struct CMViewingConditionsType    CMViewingConditionsType;
  637.  
  638. struct CMXYZType {
  639.     OSType                             typeDescriptor;                /* 'XYZ ' */
  640.     unsigned long                     reserved;                    /* fill with 0x00 */
  641.     CMFixedXYZColor                 XYZ[1];                        /* variable size XYZ tristimulus values */
  642. };
  643. typedef struct CMXYZType                CMXYZType;
  644. /* Profile sequence description type */
  645.  
  646. struct CMProfileSequenceDescType {
  647.     OSType                             typeDescriptor;                /* 'pseq ' */
  648.     unsigned long                     reserved;                    /* fill with 0x00 */
  649.     unsigned long                     count;                        /* Number of descriptions */
  650.     char                             data[1];                    /* varaible size data as explained below */
  651. };
  652. typedef struct CMProfileSequenceDescType CMProfileSequenceDescType;
  653. /*
  654.     A variable size array of structs appears as the last block of data
  655.     in the above struct, CMProfileSequenceDescType.  The data structure
  656.     is as follows: (example in C)
  657.     
  658.      struct {                                             
  659.             OSType            deviceMfg;                     * Device Manufacturer 
  660.             OSType            deviceModel;                 * Decvice Model 
  661.             unsigned long    attributes[2];                 * Device attributes 
  662.             OSType            technology;                     * Technology signature 
  663.             unsigned long    mfgDescASCIICount;             * the count of "bytes" 
  664.             unsigned char    mfgDescASCIIName[2];         * Variable size 
  665.             unsigned long    mfgDescUniCodeCode;             
  666.             unsigned long    mfgDescUniCodeCount;         * the count of characters, each character has two bytes 
  667.             unsigned char    mfgDescUniCodeName[2];         * Variable size 
  668.             unsigned long    mfgDescScriptCodeCode;         
  669.             unsigned long    mfgDescScriptCodeCount;         * the count of "bytes" 
  670.             unsigned char    mfgDescScriptCodeName[2];     * Variable size 
  671.             unsigned long    modelDescASCIICount;         * the count of "bytes" 
  672.             unsigned char    modelDescASCIIName[2];         * Variable size 
  673.             unsigned long    modelDescUniCodeCode;         
  674.             unsigned long    modelDescUniCodeCount;         * the count of characters, each character has two bytes 
  675.             unsigned char    modelDescUniCodeName[2];     * Variable size 
  676.             short            modelDescScriptCodeCode;     
  677.             unsigned char    modelDescScriptCodeCount;     * the count of "bytes" 
  678.             SInt8            filler;                         * For proper alignment across languages 
  679.             unsigned char    modelDescScriptCodeName[2];     * Variable size 
  680.      }    profileDescription[1];                         
  681. */
  682.  
  683. /* Under color removal, black generation type */
  684.  
  685. struct CMUcrBgType {
  686.     OSType                             typeDescriptor;                /* 'bfd  ' */
  687.     unsigned long                     reserved;                    /* fill with 0x00 */
  688.     unsigned long                     ucrCount;                    /* Number of UCR entries */
  689.     unsigned short                     ucrValues[1];                /* variable size */
  690.     unsigned long                     bgCount;                    /* Number of BG entries */
  691.     unsigned short                     bgValues[1];                /* variable size */
  692.     unsigned char                     ucrbgASCII[1];                /* null terminated ASCII string */
  693. };
  694. typedef struct CMUcrBgType                CMUcrBgType;
  695.  
  696. struct CMIntentCRDVMSize {
  697.     long                             renderingIntent;            /* rendering intent */
  698.     unsigned long                     VMSize;                        /* VM size taken up by the CRD */
  699. };
  700. typedef struct CMIntentCRDVMSize        CMIntentCRDVMSize;
  701.  
  702. struct CMPS2CRDVMSizeType {
  703.     OSType                             typeDescriptor;                /* 'psvm' */
  704.     unsigned long                     reserved;                    /* fill with 0x00 */
  705.     unsigned long                     count;                        /* number of intent entries */
  706.     CMIntentCRDVMSize                 intentCRD[1];                /* variable size */
  707. };
  708. typedef struct CMPS2CRDVMSizeType        CMPS2CRDVMSizeType;
  709. /************************************************************************/
  710. /*************** ColorSync 1.0 profile specification ********************/
  711. /************************************************************************/
  712.  
  713. enum {
  714.     cmGrayResponse                = 0,
  715.     cmRedResponse                = 1,
  716.     cmGreenResponse                = 2,
  717.     cmBlueResponse                = 3,
  718.     cmCyanResponse                = 4,
  719.     cmMagentaResponse            = 5,
  720.     cmYellowResponse            = 6,
  721.     cmUcrResponse                = 7,
  722.     cmBgResponse                = 8,
  723.     cmOnePlusLastResponse        = 9
  724. };
  725.  
  726.  
  727. /* Device types */
  728.  
  729. enum {
  730.     cmMonitorDevice                = FOUR_CHAR_CODE('mntr'),
  731.     cmScannerDevice                = FOUR_CHAR_CODE('scnr'),
  732.     cmPrinterDevice                = FOUR_CHAR_CODE('prtr')
  733. };
  734.  
  735.  
  736.  
  737. struct CMIString {
  738.     ScriptCode                         theScript;
  739.     Str63                             theString;
  740. };
  741. typedef struct CMIString                CMIString;
  742. /* Profile options */
  743.  
  744. enum {
  745.     cmPerceptualMatch            = 0x0000,                        /* Default. For photographic images */
  746.     cmColorimetricMatch            = 0x0001,                        /* Exact matching when possible */
  747.     cmSaturationMatch            = 0x0002                        /* For solid colors */
  748. };
  749.  
  750. /* Profile flags */
  751.  
  752. enum {
  753.     cmNativeMatchingPreferred    = 0x00000001,                    /* Default to native not preferred */
  754.     cmTurnOffCache                = 0x00000002                    /* Default to turn on CMM cache */
  755. };
  756.  
  757.  
  758. typedef long                             CMMatchOption;
  759. typedef long                             CMMatchFlag;
  760.  
  761. struct CMHeader {
  762.     unsigned long                     size;
  763.     OSType                             CMMType;
  764.     unsigned long                     applProfileVersion;
  765.     OSType                             dataType;
  766.     OSType                             deviceType;
  767.     OSType                             deviceManufacturer;
  768.     unsigned long                     deviceModel;
  769.     unsigned long                     deviceAttributes[2];
  770.     unsigned long                     profileNameOffset;
  771.     unsigned long                     customDataOffset;
  772.     CMMatchFlag                     flags;
  773.     CMMatchOption                     options;
  774.     CMXYZColor                         white;
  775.     CMXYZColor                         black;
  776. };
  777. typedef struct CMHeader                    CMHeader;
  778.  
  779. struct CMProfileChromaticities {
  780.     CMXYZColor                         red;
  781.     CMXYZColor                         green;
  782.     CMXYZColor                         blue;
  783.     CMXYZColor                         cyan;
  784.     CMXYZColor                         magenta;
  785.     CMXYZColor                         yellow;
  786. };
  787. typedef struct CMProfileChromaticities    CMProfileChromaticities;
  788.  
  789. struct CMProfileResponse {
  790.     unsigned short                     counts[9];
  791.     unsigned short                     data[1];                    /* Variable size */
  792. };
  793. typedef struct CMProfileResponse        CMProfileResponse;
  794.  
  795. struct CMProfile {
  796.     CMHeader                         header;
  797.     CMProfileChromaticities         profile;
  798.     CMProfileResponse                 response;
  799.     CMIString                         profileName;
  800.     char                             customData[1];                /* Variable size */
  801. };
  802. typedef struct CMProfile                CMProfile;
  803. typedef CMProfile *                        CMProfilePtr;
  804. typedef CMProfilePtr *                    CMProfileHandle;
  805. #if OLDROUTINENAMES
  806.  
  807. enum {
  808.     kCMApplProfileVersion        = cmCS1ProfileVersion
  809. };
  810.  
  811.  
  812. enum {
  813.     grayResponse                = cmGrayResponse,
  814.     redResponse                    = cmRedResponse,
  815.     greenResponse                = cmGreenResponse,
  816.     blueResponse                = cmBlueResponse,
  817.     cyanResponse                = cmCyanResponse,
  818.     magentaResponse                = cmMagentaResponse,
  819.     yellowResponse                = cmYellowResponse,
  820.     ucrResponse                    = cmUcrResponse,
  821.     bgResponse                    = cmBgResponse,
  822.     onePlusLastResponse            = cmOnePlusLastResponse
  823. };
  824.  
  825.  
  826. enum {
  827.     rgbData                        = cmRGBData,
  828.     cmykData                    = cmCMYKData,
  829.     grayData                    = cmGrayData,
  830.     xyzData                        = cmXYZData
  831. };
  832.  
  833.  
  834. enum {
  835.     XYZData                        = cmXYZData
  836. };
  837.  
  838.  
  839. enum {
  840.     monitorDevice                = cmMonitorDevice,
  841.     scannerDevice                = cmScannerDevice,
  842.     printerDevice                = cmPrinterDevice
  843. };
  844.  
  845.  
  846. enum {
  847.     CMNativeMatchingPreferred    = cmNativeMatchingPreferred,    /* Default to native not preferred */
  848.     CMTurnOffCache                = cmTurnOffCache                /* Default to turn on CMM cache */
  849. };
  850.  
  851.  
  852. enum {
  853.     CMPerceptualMatch            = cmPerceptualMatch,            /* Default. For photographic images */
  854.     CMColorimetricMatch            = cmColorimetricMatch,            /* Exact matching when possible */
  855.     CMSaturationMatch            = cmSaturationMatch                /* For solid colors */
  856. };
  857.  
  858.  
  859. typedef unsigned short                     XYZComponent;
  860. typedef CMXYZColor                         XYZColor;
  861. typedef unsigned short                     CMResponseData;
  862. typedef CMIString                         IString;
  863. typedef long                             CMResponseColor;
  864. typedef CMResponseColor                 responseColor;
  865.  
  866. #endif  /* OLDROUTINENAMES */
  867.  
  868.  
  869.  
  870. #if PRAGMA_STRUCT_ALIGN
  871.     #pragma options align=reset
  872. #elif PRAGMA_STRUCT_PACKPUSH
  873.     #pragma pack(pop)
  874. #elif PRAGMA_STRUCT_PACK
  875.     #pragma pack()
  876. #endif
  877.  
  878. #ifdef PRAGMA_IMPORT_OFF
  879. #pragma import off
  880. #elif PRAGMA_IMPORT
  881. #pragma import reset
  882. #endif
  883.  
  884. #ifdef __cplusplus
  885. }
  886. #endif
  887.  
  888. #endif /* __CMICCPROFILE__ */
  889.  
  890.